from PySide6.QtWidgets import QMenu
from PySide6.QtGui import QKeySequence
from custom_plain_text_edit import PlainTextEdit

class ViewMenu(QMenu):
    """查看菜单

    :param QMenu: PySide6 菜单类
    """
    def __init__(self):
        """初始化
        """
        super().__init__()
        self.setup_ui()

    def setup_ui(self):
        """设置界面
        """
        # 设置标题  
        self.setTitle("查看")

        # 添加 缩放子菜单 和行为
        zoom_menu = self.addMenu("缩放(&Z)")
        self.status_bar_action = self.addAction("状态栏(&S)")

        # 子菜单添加行为
        self.zoom_in_action = zoom_menu.addAction("放大(&I)",QKeySequence.StandardKey.ZoomIn)
        self.zoom_out_action = zoom_menu.addAction("放缩小(&O)",QKeySequence.StandardKey.ZoomOut)
        self.zoom_default_action = zoom_menu.addAction("恢复默认缩放","Ctrl+0")

        # 状态栏行为 可勾选且 默认为勾选状态
        self.status_bar_action.setCheckable(True)
        self.status_bar_action.setChecked(True)

        
